I have this JS on the onLoad event on a form. I want to check if the user has Flash-player instlled. If not he/she should be redirected to
http://www.macromedia.com/shockwave/download/triggerpages_mmcom/flash.html.
I set a variable flashinstalled, but it shows the value 0 even if I got the player installed... anybody done something like this before?
var flashinstalled = 0;
var flashversion = 0;
MSDetect = "false";
if (navigator.plugins && navigator.plugins.length)
{
x = navigator.plugins["Shockwave Flash"];
if (x)
{
flashinstalled = 2;
if (x.description)
{
y = x.description;
flashversion = y.charAt(y.indexOf('.')-1);
}
}
else
flashinstalled = 1;
}
else if (navigator.mimeTypes && navigator.mimeTypes.length)
{
x = navigator.mimeTypes['application/x-shockwave-flash'];
if (x && x.enabledPlugin)
flashinstalled = 2;
else
flashinstalled = 1;
}
else
MSDetect = "true";
document.forms[0].flash.value = flashinstalled